Skip to content

Only include relevant snippets (#3586) #3591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025
Merged

Conversation

ciarams87
Copy link
Contributor

Cherrypick of #3586

Problem: SnippetsFilters are being included in NGINX configuration for all gateways regardless of whether routes attached to those specific gateways actually referenced the filters.

Solution: Implemented gateway-specific scoping by adding GetReferencedSnippetsFilters() method that returns only SnippetsFilters referenced by routes attached to the current gateway.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Fixed an issue where SnippetsFilters were being included in NGINX configuration for all gateways regardless of whether routes attached to those specific gateways actually referenced the filters.

Problem: SnippetsFilters are being included in NGINX configuration for all gateways regardless of whether routes attached to those specific gateways actually referenced the filters.

Solution: Implemented gateway-specific scoping by adding GetReferencedSnippetsFilters() method that returns only SnippetsFilters referenced by routes attached to the current gateway.
@ciarams87 ciarams87 requested a review from a team as a code owner July 3, 2025 21:48
@github-actions github-actions bot added the bug Something isn't working label Jul 3, 2025
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 84.09091% with 7 lines in your changes missing coverage. Please review.

Project coverage is 86.81%. Comparing base (271ca22) to head (d85ddce).
Report is 1 commits behind head on release-2.0.

Files with missing lines Patch % Lines
internal/controller/state/graph/gateway.go 81.57% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release-2.0    #3591      +/-   ##
===============================================
- Coverage        86.82%   86.81%   -0.02%     
===============================================
  Files              127      127              
  Lines            15087    15127      +40     
  Branches            62       62              
===============================================
+ Hits             13100    13133      +33     
- Misses            1836     1840       +4     
- Partials           151      154       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjberman sjberman enabled auto-merge (squash) July 7, 2025 17:40
@sjberman sjberman merged commit 9706882 into release-2.0 Jul 7, 2025
42 of 43 checks passed
@sjberman sjberman deleted the fix/snippets-scope branch July 7, 2025 18:07
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants